\documentclass[12pt]{article}
\usepackage[table]{xcolor}
\usepackage[titletoc, page,header]{appendix}
\usepackage{titletoc}
\usepackage{hyperref}
\hypersetup{
        colorlinks=true,
        breaklinks,
        allcolors=[RGB]{128,0,0}
}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}

\usepackage[lmargin=1in,rmargin=1in, top=1in, bottom=1in,
marginparwidth=1.3in, marginparsep=.2in, heightrounded]{geometry} % wider margins
%\usepackage[top=2cm, bottom=1.3cm, left=5cm, right=5cm, heightrounded,
%  marginpsubarwidth=4.6cm, marginparsep=3mm]{geometry}

\usepackage{dcolumn}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}
\usepackage{ctable}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{setspace}
\usepackage{rotating}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{marginnote}
\usepackage{pdflscape}
\usepackage{placeins}
\usepackage{dsfont}

\usepackage[margin=10pt,font=small,labelfont=bf, labelsep=endash]{caption}

\usepackage{graphicx}
\usepackage{subcaption}
% \usepackage{subfig}

\usepackage{wrapfig}
\usepackage{floatrow}
\usepackage{colortbl}
\usepackage{tabu}
\usepackage{threeparttable}
\usepackage{threeparttablex}
\usepackage[normalem]{ulem}
\usepackage{makecell}
\usepackage{xcolor}

\renewcommand{\textfraction}{0.05}
\renewcommand{\topfraction}{0.8}
\renewcommand{\bottomfraction}{0.8}
\renewcommand{\floatpagefraction}{0.75}

% To do notes
\usepackage{xargs}
\setlength{\marginparwidth}{2cm}
%\usepackage[pdftex]{xcolor}  % Coloured text etc.
%
\usepackage[colorinlistoftodos,prependcaption,textsize=tiny]{todonotes}
\newcommandx{\unsure}[2][1=]{\todo[linecolor=red,backgroundcolor=red!25,bordercolor=red,#1]{#2}}
\newcommandx{\change}[2][1=]{\todo[linecolor=blue,backgroundcolor=blue!25,bordercolor=blue,#1]{#2}}
\newcommandx{\info}[2][1=]{\todo[linecolor=OliveGreen,backgroundcolor=OliveGreen!25,bordercolor=OliveGreen,#1]{#2}}
\newcommandx{\improvement}[2][1=]{\todo[linecolor=Plum,backgroundcolor=Plum!25,bordercolor=Plum,#1]{#2}}
\newcommandx{\thiswillnotshow}[2][1=]{\todo[disable,#1]{#2}}


% Bibliography
\usepackage[american]{babel}
\usepackage[autostyle]{csquotes}
\usepackage[authordate, backend=biber, bibencoding=utf8, natbib, safeinputenc, doi=false,isbn=false,url=false]{biblatex-chicago}
\addbibresource{edu_paper.bib}
% \usepackage{natbib}
% \usepacakge{bibtex}

% \bibliography{edu.bib}

%%For Hypotheses and Subhypotheses
\usepackage{ntheorem}
\theoremstyle{numberplain}
\theoremheaderfont{\bfseries\itshape}% Remove \bfseries if you only want the title in italic
\theorembodyfont{\upshape}
\newtheorem{hyp}{Hypothesis}
\makeatletter
\newcounter{subhyp}
\let\savedc@hyp\c@hyp
\newenvironment{subhyp}
 {%
  \setcounter{subhyp}{0}%
  \stepcounter{hyp}%
  \edef\saved@hyp{\thehyp}% Save the current value of hyp
  \let\c@hyp\c@subhyp     % Now hyp is subhyp
  \renewcommand{\thehyp}{\saved@hyp\alph{hyp}}%
 }
 {}
\newcommand{\normhyp}{%
  \let\c@hyp\savedc@hyp % revert to the old one
  \renewcommand\thehyp{\arabic{hyp}}%
}
\makeatother
%%%

%For nice tables
\usepackage{booktabs}
\usepackage{array}
\usepackage{threeparttable}
\usepackage{tabulary}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
\usepackage{tablefootnote}
\usepackage{longtable}
\usepackage{siunitx}
%\usepackage[table]{xcolor}
\usepackage{hhline}
\usepackage{calc}
\usepackage{tabularx}

%For compact lists
\usepackage{enumitem}
\setlist{nosep} % or \setlist{noitemsep} to leave space around whole list


%Expectation operator
\newcommand{\Expect}{{\rm I\kern-.3em E}}

%Significance commands
\newcommand*{\SuperScriptSameStyle}[1]{%
  \ensuremath{%
    \mathchoice
      {{}^{\displaystyle #1}}%
      {{}^{\textstyle #1}}%
      {{}^{\scriptstyle #1}}%
      {{}^{\scriptscriptstyle           #1}}%
           }%
}

\newcommand*{\oneS}{\SuperScriptSameStyle{*}}
\newcommand*{\twoS}{\SuperScriptSameStyle{**}}
\newcommand*{\threeS}{\SuperScriptSameStyle{*{*}*}}

\setlength\parindent{22pt} % indentation

%\onehalfspacing

\usepackage{footmisc}
\setlength{\footnotesep}{ \baselineskip}
\renewcommand{\footnotesize}{\normalsize}
\renewcommand{\footnotelayout}{\doublespacing}

\begin{document}


\title{  \Large Competence versus Priorities: Negative Electoral Responses to Education Quality in Brazil\\~\\Tables and Figures}

\author{Taylor Boas \\ Boston University \and F. Daniel Hidalgo \\ MIT \and Guillermo Toral \\ MIT}

\date{}

\maketitle
%\thispagestyle{empty}
\begin{center}
\end{center}

\vspace{-3em}

\newlength{\alphabetlength}
\settowidth{\alphabetlength}{abcdefghijklmnopqrstuvwxyz}
\bigskip

\doublespacing
\newpage
\setcounter{page}{1}


\begin{table}[htb!]
\caption{Effect of Meeting the IDEB Target on Re-election of the Mayor}
\label{tab:rdd_results_reelection}
  \centering
  \centerline{%
    \input{rdd/tables/rdd_results_reelection.tex}
  }
   
  \floatfoot{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01.\\
  Note. The bandwidth is determined by the algorithm of \citet{calonico2014}. Standard errors in parentheses are consistent for heteroskedasticity (HC1 in models 1-2, and nearest-neighbor in models 3-4.)}
\end{table}

\begin{figure}[htb!]
  \centering
  \includegraphics[width=.8\linewidth]{rdd/figures/rdplot_reelection.pdf} 
\caption{Effect of Meeting the IDEB Target on Re-election of the Mayor. Dots represent local averages for 50 equally-sized bins. Lines are loess regression lines estimated at both
  sides of the threshold with no controls. Shaded regions
are their 95\% confidence intervals.}
\label{fig:rdd_plot_reelection}
\end{figure}

\begin{figure}[ht]
  \centering
  \includegraphics[width=.75\textwidth]{rct/figures/ame_rank.pdf}
  \caption{Effect of Treatment by Educational Performance. Black line is
    estimated marginal effect of treatment estimated using a linear interaction.
    Points are effects estimated separately in bins defined by the terciles of
    ANA Rank. 95\% Confidence Intervals are shown. Histogram shows marginal
    distribution of ANA Rank.}
  \label{fig:effect_rank}
\end{figure}

\begin{figure}[htb!]
  \centering
  \includegraphics[width=1\textwidth]{rct/figures/ame_child_vs_nochild_plot.pdf}
  \caption{Effect of Treatment Among Respondents With and Without Children in Local Schools. Black line is
    estimated marginal effect of treatment estimated using a linear interaction.
    Points are effects estimated separately in bins defined by the terciles of
    ANA Rank. 95\% Confidence Intervals are shown. Histogram shows marginal
    distribution of ANA Rank. \label{fig:parents_main}}
\end{figure}

\begin{table}[htb!]
\caption{Effect of Information Treatment.}
  \centering
  \centerline{%
    \input{rct/tables/exp_mainresults.tex}
  }
  \floatfoot{Note. Covariates omitted. Covariates demeaned so treatment coefficient is estimated average treatment effect. HC2 heteroskedasticity consistent standard errors in parentheses.}
  \label{tab:exp_results}
\end{table}

\begin{figure}[ht]
  \centering
  \includegraphics[width=.9\textwidth]{online_survey/figures/positive_treatment_conditional.pdf}
  \caption{Conditional Average Treatment Effects (CATE) of receiving positive information about the quality of schools on respondents' agreement with statements about the mayor, by whether they give high or low priority to education. Outcomes are measured in scales that go from 1 (``disagree completely'') to 4 (``agree completely''). The "education more valued" group is composed of those who rank education at the median or above it (i.e. among their top two priorities). The ``education less valued" group is composed of those who rank at least two policy areas above education.}
  \label{fig:facebook_het}
\end{figure}

\renewcommand\thefigure{A.\arabic{figure}}
\renewcommand{\thetable}{A.\arabic{table}}
\setcounter{table}{0}
\setcounter{figure}{0}

\begin{figure}[h]
    \centering
    \includegraphics[width=.95\textwidth]{rdd/figures/google_trends.pdf}
   \caption{Relative frequency of Google searches in Brazil for the
      terms ``IDEB'', ``corruption'', ``inflation'', and ``Bolsa Familia'' from 2008 to 2016, by month. Data are from Google Trends.}
    \label{fig:google_trends}
\end{figure}

\setcounter{table}{1}
\setcounter{figure}{2}

\begin{figure}[h]
    \centering
    \includegraphics[width=\textwidth]{rdd/figures/histogram_forcingvariable.pdf}
    \vspace{-1em}
   \caption{Histograms of the forcing variable, by test year.}
    \label{fig:histogram_forcing_var}
\end{figure}

\begin{figure}[ht]
  \centering
  \includegraphics[width=\textwidth]{rdd/figures/density_forcingvariable.pdf}
      \vspace{-1em}
  \caption{Density plots and results of the \citet{mccrary2008} test for the forcing variable (IDEB score
    - IDEB target), by test year.}
  \label{fig:mccrary}
\end{figure}

\begin{table}[ht!]
\caption{Continuity of pre-treatment covariates.}
\label{tab:rdd_continuity_covariates}
  \centering
    \input{rdd/tables/rdd_continuity_covariates.tex}
 \floatfoot{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01. \\ Note. The difference between municipalities where the IDEB target is met and those where it is missed is calculated using each covariate as the dependent variable in Equation 3, within the bandwidth specified by the \citet{calonico2014} algorithm. Standard errors are consistent for heteroskedasticity (HC1).}
\end{table}

\setcounter{table}{3}

\input{rdd/tables/rdd_sample.tex}

\begin{table}[ht]
\caption{Effect of Meeting the IDEB Target on Re-election of the Mayor}
\label{tab:rdd_results_voteshare}
  \centering
    \input{rdd/tables/rdd_results_voteshare.tex}    
  \floatfoot{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01.\\
  Note. The bandwidth is the one determined by the algorithm of \citet{calonico2014}. Standard errors in parentheses are consistent for heteroskedasticity (HC1 in models 1-2, and nearest-neighbor in models 3-4.)}
\end{table}

\begin{figure}[ht]
  \centering
  \includegraphics[width=\linewidth]{rdd/figures/rdplot_voteshare.pdf}
  \caption{Relationship between meeting the IDEB target and vote share of the mayor. Grey dots are observations. Colored dots represent local averages for
  50 equally-sized bins. Lines are loess regression lines estimated at both
  sides of the threshold with no controls. Shaded regions
are their 95\% confidence intervals.}
  \label{fig:rdd_plot_voteshare}
\end{figure}

\begin{table}[ht!]
\caption{Effect of Meeting the IDEB Target on Whether the Mayor Runs for Re-Election}
\label{tab:rdd_results_decisiontorun}
  \centering
    \input{rdd/tables/rdd_results_decisiontorun.tex}
  \floatfoot{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01.\\
  Note. The bandwidth is the one determined by the algorithm of \citet{calonico2014}. Standard errors in parentheses are consistent for heteroskedasticity (HC1 in models 1-2, and nearest-neighbor in models 3-4.)}
\end{table}

\begin{figure}[ht]
\centering
   \begin{subfigure}[b]{\textwidth}
\centering
   \includegraphics[width=\linewidth]{rdd/figures/robustness_bw_reelection.pdf}
   \caption{Mayor re-election}
\end{subfigure}
\begin{subfigure}[b]{\textwidth}
\centering
   \includegraphics[width=\linewidth]{rdd/figures/robustness_bw_voteshare.pdf}
   \caption{Mayor vote-share}
\end{subfigure}
\caption{Robustness of the treatment effect shown in model 2 in Tables 1 and A5 (local linear with controls) to alternative bandwidths.}
\label{fig:robustness_bandwidth}
\end{figure}

\begin{figure}[ht]
  \centering
  \includegraphics[width=\linewidth]{rdd/figures/placebotests_threshold.pdf}
  \caption{Placebo tests using alternative discontinuity thresholds for Model 2 in Table 1. For instance, placebo test using 0.5 as the discontinuity threshold replicates the analyses as if only municipalities with an IDEB score 0.5 points above the target had met their expected level of performance.}
  \label{fig:rdd_plot_voteshare}
\end{figure}

\begin{table}[htb!]
\caption{Effect of Meeting the IDEB Target on Re-election of the Mayor -- No constraints}
\label{tab:rdd_noconstraints_reelection}
  \centering
    \input{rdd/tables/rdd_noconstraints_reelection.tex}
  \floatfoot{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01.\\
  Note. The bandwidth is the one determined by the algorithm of \citet{calonico2014}. Standard errors in parentheses are consistent for heteroskedasticity (HC1 in models 1-2, and nearest-neighbor in models 3-4.)}
\end{table}

\begin{table}[htb!]
\caption{Effect of Meeting the IDEB Target on Vote Share of the Incumbent -- No constraints}
\label{tab:rdd_noconstraints_voteshare}
  \centering
    \input{rdd/tables/rdd_noconstraints_voteshare.tex}
  \floatfoot{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01.\\
  Note. The bandwidth is the one determined by the algorithm of \citet{calonico2014}. Standard errors in parentheses are consistent for heteroskedasticity (HC1 in models 1-2, and nearest-neighbor in models 3-4.)}
\end{table}

\begin{table}[htb!]
\caption{Effect of Meeting the IDEB Target on Re-election of the Mayor -- Heterogeneity by School Enrolments}
\label{tab:rdd_het_reelection}
  \centering
    \input{rdd/tables/rdd_results_heterogeneity_reelection.tex}
  \floatfoot{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01.\\
  Note. The bandwidth is the one determined by the algorithm of \citet{calonico2014}. Standard errors in parentheses are consistent for heteroskedasticity (HC1). High enrolments is an indicator for whether the number of children enrolled in municipal schools as a share of the overall population is in the upper quartile.}
\end{table}

\begin{table}
\caption{Effect of Meeting the IDEB Target on Vote Share of the Mayor -- Heterogeneity by School Enrolments}
\label{tab:rdd_het_voteshare}
  \centering
    \input{rdd/tables/rdd_results_heterogeneity_voteshare.tex}
  \floatfoot{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01.\\
  Note. The bandwidth is the one determined by the algorithm of \citet{calonico2014}. Standard errors in parentheses are consistent for heteroskedasticity (HC1). High enrolments is an indicator for whether the number of children enrolled in municipal schools as a share of the overall population is in the upper quartile.}
\end{table}

\renewcommand\thefigure{B.\arabic{figure}}
\renewcommand{\thetable}{B.\arabic{table}}

\begin{figure}[ht]
  \centering
  \includegraphics[width=.8\textwidth]{rct/figures/ana_hist.pdf}
  \caption{ANA distribution}
  \label{fig:ana_hist}
\end{figure}

\setcounter{table}{11}

\begin{table}[ht]
  \centering
  \footnotesize
  \centerline{%
    \input{rct/tables/exp_mainresults_nocovars.tex}
  }
  \caption{Experimental results without covariate adjustment. Experimental
    block coefficients are omitted. HC2
    heteroskedasticity consistent standard errors in parentheses. }
  \label{tab:unadjusted}
\end{table}

\begin{table}[ht]
  \centering
  \footnotesize
  \centerline{%
    \input{rct/tables/exp_mainresults_otherinter.tex}
  }
  \caption{Experimental results with additional interactions. These estimates
    are from the regression models reported in Table 2
    augmented with the interaction between the treatment and age, income, and
    years of education.  HC2
    heteroskedasticity consistent standard errors in parentheses. }
  \label{tab:other_inter}
\end{table}

\begin{table}[ht]
  \centering
    \input{rct/tables/exp_mainresults_anabaseline.tex}
  \caption{Robustness of Experimental Results to Including Interaction between Treatment and Baseline ANA Performance. Covariates omitted. Covariates demeaned so treatment coefficient is estimated average treatment effect. HC2 heteroskedasticity consistent standard errors in parentheses.}
  \label{tab:exp_results_anabaseline}
\end{table}

\setcounter{figure}{10}


\begin{figure}
  \centering
  \includegraphics[width=.9\textwidth]{rct/figures/ame_edugap.pdf}
  \caption{Effect of Treatment by Gap Between Voters' Prior and Municipal
    Performance. Negative values indicate worse performance than expected, while
    positive values indicate better performance than expected. 90\% Confidence Intervals are shown.
  Histogram shows marginal distribution of the data by the gap.}
  \label{fig:effect_gap}
\end{figure}

\begin{table}[ht]
  \centering
  \footnotesize
  \centerline{%
    \input{rct/tables/exp_balance.tex}
  }
  \caption{Covariate Balance for the Pernambuco Experiment. The mean difference
    column reports estimated ATE for pre-treatment covariates specified in PAP.
    SD is standard deviation of variable. Permutation p-value is computed using
    2000 permutations of the treatment variable. Most imbalanced variables are
    at the top of the table, as variables are ordered by the
    absolute value of the  mean difference divided by the standard
    deviation.}
\label{tab:exp_balance}
\end{table}

\begin{table}[ht]
  \centering
  \footnotesize
  \centerline{%
    \input{rct/tables/exp_attrition.tex}
  }
  \caption{Correlation of Treatment with Attrition in the Pernambuco Experiment. These estimates are from a regression of an attrition indicator on treatment,  covariates,  treatment by covariate interactions, and block fixed effects. All covariates were demeaned.  Coefficients on covariate main effects and block strata are omitted.}
\label{tab:exp_attrition}
\end{table}

\begin{table}
  \centering
  \resizebox{\linewidth}{!}{
    \input{rct/tables/prereg_results.tex}
    }
  \caption{Results for Pre-Registered Hypotheses. See pre-analysis plan for
    details.}
  \label{tab:prereg}
\end{table}

\renewcommand\thefigure{C.\arabic{figure}}
\renewcommand{\thetable}{C.\arabic{table}}


\input{online_survey/tables/survey_balance_all.tex}

\input{online_survey/tables/survey_balance_pos.tex}

\input{online_survey/tables/survey_balance_neg.tex}

\FloatBarrier
\clearpage

\begin{figure}[htb!]
  \centering
  \includegraphics[width=.95\textwidth]{online_survey/figures/policy_areas_mean_ranks.pdf}
  \caption{Mean ranking given by online survey respondents when asked to rank policy areas according to the priority they should be given by their municipal government}
  \label{fig:policy_areas_online}
\end{figure}

\begin{landscape}

\input{online_survey/tables/survey_positive.tex}

\input{online_survey/tables/survey_negative.tex}

\input{online_survey/tables/survey_positive_heterogeneous}

\input{online_survey/tables/survey_negative_heterogeneous}

\input{online_survey/tables/survey_positive_reweighted.tex}

\input{online_survey/tables/survey_negative_reweighted.tex}

\input{online_survey/tables/survey_positive_heterogeneous_reweighted.tex}

\input{online_survey/tables/survey_negative_heterogeneous_reweighted.tex}

\input{online_survey/tables/survey_positive_heterogeneous_verylow.tex}

\input{online_survey/tables/survey_negative_heterogeneous_verylow.tex}

\end{landscape}

\begin{figure}[ht]
  \centering
  \includegraphics[width=.9\textwidth]{online_survey/figures/positive_treatment_conditional_verylow.pdf}
  \caption{Conditional Average Treatment Effects (CATE) of receiving positive information about the quality of schools on respondents' agreement with statements about the mayor, by whether they give very low priority to education. Outcomes are measured in scales that go from 1 (``disagree completely'') to 4 (``agree completely''). The "education more valued" group is composed of those who rank education among their top three priorities. The ``education less valued" group is composed of those who rank at least three policy areas above education.}
  \label{fig:facebook_het}
\end{figure}

\renewcommand\thefigure{D.\arabic{figure}}
\renewcommand{\thetable}{D.\arabic{table}}

\begin{table}[h]
\caption{Relationship between municipal education spending (measured as increase from 2013 to 2017, relative to 2013), and performance of municipal primary education schools in IDEB.}
  \centering
  \centerline{%
    \input{spending_ideb/tables/spending_ideb.tex}
  }
  
  \label{tab:spending_ideb} 
    \floatfoot{Note. Intercept omitted from the table. HC2 heteroskedasticity consistent standard errors in parentheses.}
\end{table}


\begin{figure}[htb!]
  \centering
  \includegraphics[width=.75\textwidth]{spending_ideb/figures/spending_ideb.pdf}
  \caption{Relationship between relative increases in municipal education spending and relative increases in municipal school quality scores. Red line is the regression line from Model 4 in Table~\ref{tab:spending_ideb}.}
  \label{fig:spending_ideb}
\end{figure}

\clearpage
\singlespacing
\centering
\input{descriptives/tables/sample_stats_table.tex}
\begin{minipage}{.93\textwidth} \small
Figures are percentages, except for median population and median age. RDD figures are municipal-level averages of census data for all unique municipalities within the bandwidth, weighting each municipality equally. Survey and Brazilian census figures weight each individual equally. Education is the highest level completed. Census figures are for residents 18 and older, except for median municipal population. All census data are from 2010.
\end{minipage}

\clearpage
\centering
\input{descriptives/tables/problem_table.tex}
\begin{minipage}{.87\textwidth} \small
Entries are percentage of respondents spontaneously mentioning each item. Some categories combine similar items labeled separately in the data files.\\~\\
\end{minipage}

\begin{figure}[ht]
	\centering
	\caption{Biggest Problem and Biggest Campaign Issue in the Municipality: Pernambuco Survey}
	\includegraphics[scale=1]{descriptives/figures/biggest_problem.pdf}
	\label{fig:biggest_problem}
\end{figure}

\clearpage
\input{descriptives/tables/edu_problem_models.tex}
\begin{minipage}{.87\textwidth} \small
NOTE: Entries are logistic regression coefficients with estimated standard errors in parentheses. Model 1 analyzes the biggest problem facing the country using the 2008, 2010, 2012, 2014, 2017, and 2019 waves of the AmericasBarometer by LAPOP and includes region and year fixed effects. Model 2 analyzes the biggest problem facing the municipality using the Pernambuco panel survey. Model 3 analyzes priorities in the municipality using the online survey and includes region fixed effects. *$p < 0.1$; **$p < 0.05$; ***$p < 0.01$.
\end{minipage}

\newpage

\printbibliography

\end{document}
